begin
  require 'pathname'
  require 'yardstick'
  require 'yardstick/rake/measurement'
  require 'yardstick/rake/verify'

  # yardstick_measure task
  Yardstick::Rake::Measurement.new('yardstick')

  # verify_measurements task
  Yardstick::Rake::Verify.new('yardstick:verify') do |verify|
    verify.threshold = 100
  end
rescue LoadError
  %w(yardstick yardstick:verify).each do |name|
    task name do
      abort "Yardstick is not available. In order to run #{name}, you " \
            "must: gem install yardstick"
    end
  end
end
